﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AlbumCategoriesUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.PhotoAlbum.AlbumCategories.AlbumCategoriesUserControl" %>
<script type="text/javascript">
    function RedirectToViewAllAlbums(sender, type) {
        sender.href = "ViewAllAlbums.aspx?Type=" + type;
    }

    function RedirectToViewObjectAlbums(sender, type) {
        sender.href = "ViewObjectAlbums.aspx?Type=" + type;
    }

    function RedirectToViewAlbums(sender, type, appid) {
        location.href = "ViewAllAlbums.aspx?Type=" + type + "&appid=" + appid;
        return false;
    }

    function RedirectToViewAlbum(sender, albumId) {
        sender.href = "ViewAlbum.aspx?AlbumId=" + albumId;
    }

    function RedirectToAddAlbum(sender) {
        sender.href = "AddAlbum.aspx";
    }

    function RedirectToStaffProfile(sender, staffId) {
        sender.href = "/PersonalSite/PersonalPages/PublicUser.aspx?StaffId=" + staffId;
    }

    function ResizeImage(sender) {
        var image = new Image();
        image.src = sender.src;
        if (image.width > 0 && image.height > 0) {
            var height = image.height;
            var width = image.width;
            if (parseInt(width) / parseInt(height) >= 159 / 126) {
                sender.style.height = 126;
            }
        }
    }
    function RedirectToFunHome() {
        window.location.href = "AlbumCategories.aspx";
    }
</script>
<style type="text/css">
     #background
    {
        z-index: -1;
        border: 1px solid #B8B8B8;
        width: 130px;
        height: 125px;
    }
    #imagebox
    {
        border: 1px solid #B8B8B8;
        margin-left: 4px;
        margin-top: 4px;
        width: 125px;
        height: 120px;
        background-color: #ffffff;
        padding: 4px;
    }
    
    #containerImg
    {
        width: 125px;
        height: 120px;
        padding: 0px;
        overflow: hidden;
        float: none;
    }
</style>
<div>
    <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="top" width="100%">
                <table class="content" width="99%">
                    <tr>
                        <td>
                            <div class="gallery">
                                <table width="100%" class="galleryTitle">
                                    <tr>
                                        <td width="60%">
                                            <h2 class="gallery">
                                                <asp:Image ID="Image1" runat="server" ImageUrl="/_layouts/JM.JCY.Resource/images/相册小.png"
                                                    Width="24" />
                                                <a href="javascript:RedirectToFunHome()">我的相册</a>
                                            </h2>
                                        </td>
                                        <td class="link" align="right" width="40%">
                                       <img src="/_layouts/JM.JCY.Resource/images/plus.png" width="12" />
                                            <asp:LinkButton ID="lbCreateAlbum" CssClass="link" runat="server" class="galleryDetail"
                                                OnClientClick="RedirectToAddAlbum(this)">创建相册</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <br />
                            <table class="galleryHeader" width="100%">
                                <tr>
                                    <td width="70%">
                                        <asp:Label ID="Label3" runat="server" Text="所有公开的相册"></asp:Label>
                                    </td>
                                    <td width="30%" align="right" class="link">
                                        <asp:LinkButton ID="lbViewAll1" runat="server" OnClientClick="RedirectToViewAllAlbums(this,'P')">更多...</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" class="photoAlbum" style="margin-bottom: 20px">
                                <tr>
                                    <td>
                                        <asp:DataList ID="dlPublicAlbum" runat="server" RepeatDirection="Horizontal" RepeatColumns="5"
                                            OnItemDataBound="DateList_ItemDataBound">
                                            <ItemTemplate>
                                                <div>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <div class="ThumbNailImg">
                                                                    <div id="background">
                                                                        <div id="imagebox">
                                                                            <div id="containerImg">
                                                                                <a id="img" href="#" class="link" onclick="RedirectToViewAlbum(this,'<%# Eval("AlbumId") %>')">
                                                                                    <img id="imgThumbNail" src='<%# Eval("ThumbNailImgUrl") %>' width="130" height="125"
                                                                                        class="photoAlbum" alt='<%# Eval("Description") %>' onload="ResizeImage(this);" />
                                                                                </a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <asp:LinkButton ID="lbAlbumName" CssClass="link" runat="server" Text='<%# PartSubString("AlbumName",Eval("Name").ToString()) %>'
                                                                                OnClientClick='<%# String.Format("RedirectToViewAlbum({0},{1})","this",Eval("AlbumId")) %>'
                                                                                ToolTip='<%# Eval("Name") %>'></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <asp:Label ID="lblBy" runat="server" CssClass="gallery" Text="创建人："></asp:Label>
                                                                            <asp:LinkButton ID="lbCreateBy" CssClass="link" runat="server" Text='<%# PartSubString("AlbumOwner",Eval("AlbumOwner").ToString()) %>'
                                                                                ToolTip='<%# Eval("AlbumOwner") %>' OnClientClick='<%# String.Format("RedirectToStaffProfile({0},{1})","this",Eval("Creator")) %>'></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                    <tr runat="server" id="trDetail">
                                                                        <td nowrap="nowrap" style="width: 90px;">
                                                                            <asp:Label ID="lblMediaCount" CssClass="gallery" runat="server" Text='<%# Eval("ItemCount") %>'></asp:Label>
                                                                            <asp:Label ID="lblMedia" CssClass="gallery" runat="server" Text="照片"></asp:Label>
                                                                            <asp:Image ID="imgLike" runat="server" ImageUrl="/_layouts/JM.JCY.Resource/images/thumbs-up.gif" />
                                                                            <asp:Label ID="lblLikeCount" CssClass="gallery" runat="server" Text='<%# Eval("LikeCount") %>'></asp:Label>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>
                            <table class="galleryHeader" width="100%">
                                <tr>
                                    <td width="70%">
                                        <asp:Label ID="Label4" runat="server" Text="所属部门的相册"></asp:Label>
                                    </td>
                                    <td width="30%" align="right" class="link">
                                        <asp:LinkButton ID="lbViewAll2" runat="server" OnClientClick="RedirectToViewObjectAlbums(this,'W')">更多...</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" class="photoAlbum" style="margin-bottom: 20px">
                                <tr>
                                    <td>
                                        <asp:DataList ID="dlWorkgroup" runat="server" RepeatDirection="Horizontal" RepeatColumns="5"
                                            OnItemDataBound="DateList_ItemDataBound">
                                            <ItemTemplate>
                                                <div>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <div class="ThumbNailImg">
                                                                    <div id="background">
                                                                        <div id="imagebox">
                                                                            <div id="containerImg">
                                                                                <a id="img" href="#" onclick="RedirectToViewAlbums(this,'W','<%# Eval("DepartmentId") %>')">
                                                                                    <img id="imgThumbNail" src="/_layouts/JM.JCY.Resource/images/albumNew.png"
                                                                                        height="120" class="photoAlbum" alt='<%# Eval("DeptName") %>' onload="ResizeImage(this);" />
                                                                                </a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <a class="link" title='<%# Eval("DeptName") %>' href="javascript:RedirectToViewAlbums(this,'<%# Eval("appType") %>','<%# Eval("DepartmentId") %>')">
                                                                                <%# Eval("DeptName") %></a>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>
                            <table class="galleryHeader" width="100%">
                                <tr>
                                    <td width="70%">
                                        <asp:Label ID="Label1" runat="server" Text="所属专题小组的相册"></asp:Label>
                                    </td>
                                    <td width="30%" align="right" class="link">
                                        <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="RedirectToViewObjectAlbums(this,'C')">更多...</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" class="photoAlbum" style="margin-bottom: 20px">
                                <tr>
                                    <td>
                                        <asp:DataList ID="DataListCommittee" runat="server" RepeatDirection="Horizontal"
                                            RepeatColumns="5" OnItemDataBound="DateList_ItemDataBound">
                                            <ItemTemplate>
                                                <div>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <div class="ThumbNailImg">
                                                                    <div id="background">
                                                                        <div id="imagebox">
                                                                            <div id="containerImg">
                                                                                <a id="img" href="#" onclick="RedirectToViewAlbums(this,'C','<%# Eval("CommitteeId") %>')">
                                                                                    <img id="imgThumbNail" src="/_layouts/JM.JCY.Resource/images/albumNew.png"
                                                                                        height="120" class="photoAlbum" alt='<%# Eval("CommitteeName") %>' onload="ResizeImage(this);" />
                                                                                </a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <a class="link" title='<%# Eval("CommitteeName") %>' href='javascript:RedirectToViewAlbums(this,"C",<%# Eval("CommitteeId") %>)'>
                                                                                <%# Eval("CommitteeName")%></a>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>
                    <%--        <table class="galleryHeader" width="100%">
                                <tr>
                                    <td width="70%">
                                        <asp:Label ID="Label5" runat="server" Text="我私人的相册"></asp:Label>
                                    </td>
                                    <td width="30%" align="right" class="link">
                                        <asp:LinkButton ID="lbViewAll3" runat="server" OnClientClick="RedirectToViewAllAlbums(this,'PS')">更多...</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" class="photoAlbum" style="margin-bottom: 20px">
                                <tr>
                                    <td>
                                        <asp:DataList ID="dlMyContributions" runat="server" RepeatDirection="Horizontal"
                                            RepeatColumns="5" OnItemDataBound="DateList_ItemDataBound">
                                            <ItemTemplate>
                                                <div>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <div class="ThumbNailImg">
                                                                    <div id="background">
                                                                        <div id="imagebox">
                                                                            <div id="containerImg">
                                                                                <a id="img" href="#" class="link" onclick="RedirectToViewAlbum(this,'<%# Eval("AlbumId") %>')">
                                                                                    <img id="imgThumbNail" src='<%# Eval("ThumbNailImgUrl") %>' width="159" class="photoAlbum"
                                                                                        alt='<%# Eval("Description") %>' onload="ResizeImage(this);" />
                                                                                </a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%">
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <asp:LinkButton ID="lbAlbumName" CssClass="link" runat="server" Text='<%# PartSubString("AlbumName",Eval("Name").ToString()) %>'
                                                                                OnClientClick='<%# String.Format("RedirectToViewAlbum({0},{1})","this",Eval("AlbumId")) %>'
                                                                                ToolTip='<%# Eval("Name") %>'></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <asp:Label ID="lblBy" CssClass="gallery" runat="server" Text="创建人："></asp:Label>
                                                                            <asp:LinkButton ID="lbCreateBy" CssClass="link" runat="server" Text='<%# PartSubString("AlbumOwner",Eval("AlbumOwner").ToString()) %>'
                                                                                ToolTip='<%# Eval("AlbumOwner") %>' OnClientClick='<%# String.Format("RedirectToStaffProfile({0},{1})","this",Eval("Creator")) %>'></asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                    <tr runat="server" id="trDetail">
                                                                        <td nowrap="nowrap" style="width: 90px;">
                                                                            <asp:Label ID="lblMediaCount" CssClass="gallery" runat="server" Text='<%# Eval("ItemCount") %>'></asp:Label>
                                                                            <asp:Label ID="lblMedia" CssClass="gallery" runat="server" Text="照片"></asp:Label>
                                                                            <asp:Image ID="imgLike" runat="server" ImageUrl="/_layouts/JM.JCY.Resource/images/thumbs-up.gif" />
                                                                            <asp:Label ID="lblLikeCount" CssClass="gallery" runat="server" Text='<%# Eval("LikeCount") %>'></asp:Label>
                                                                        </td>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>--%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
